﻿using Device;
using Prism.Commands;
using Prism.Mvvm;
using Prism.Regions;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Net;
using System.Text;
using System.Windows.Controls.Primitives;
using WpfApp.Common;
using WpfApp.Models;
using WpfApp.UserControls;
using WpfApp.Views;

namespace WpfApp.ViewModels
{
    public class AnchorViewModel : BindableBase
    {
        private readonly IRegionManager regionManager;
        private ObservableCollection<MenuBar> menuBars;
        public ObservableCollection<MenuBar> MenuBars
        {
            get { return menuBars; }
            set { menuBars = value; RaisePropertyChanged(); }
        }
        public AnchorViewModel(IRegionManager regionManager)
        {
            MenuBars = new ObservableCollection<MenuBar>();
            CreateMenuBar();
            this.regionManager = regionManager;
        }
        void CreateMenuBar()
        {
            MenuBars.Add(new MenuBar() { Icon = "Wan", Title = "UDP", NameSpace = "UdpAnchorView", Content = new UdpAnchorView()});
            MenuBars.Add(new MenuBar() { Icon = "UsbPort", Title = "串口", NameSpace = "SerialPortAnchorView", Content = new SerialPortAnchorView() });
        }
    }
}
